package edu.cicese.ans;

import com.jsurf.SurfUtil;

/**
 * Created by: Eduardo Quintana Contreras
 * Date: 18/05/11
 * Time: 12:52 PM
 */
public class TPOIRepository extends Thread{
	private boolean threadDone = false;

	public void done() {
		threadDone = true;
	}

	@Override
	public void run() {
//		try {
//			sleep(5000);
//		} catch (InterruptedException e) {
//			e.printStackTrace();
//		}
		while(!threadDone) {
			Utilities.print("Checking POI-changelog");
			if (!Utilities.loadingPOIs) {
				SurfUtil.updatePOIs();
				try {
					sleep(60000);
				} catch (InterruptedException e) { e.printStackTrace(); }
			}
			else {
				try {
					sleep(10000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
